from PIL import Image, ImageDraw

def create_pixel_logo():
    # 创建32x32的图像
    size = 32
    img = Image.new('RGBA', (size, size), (0, 0, 0, 0))
    draw = ImageDraw.Draw(img)
    
    # 定义颜色
    primary_color = (124, 58, 237)    # 紫色
    
    # 绘制"P"字母的像素图案
    pixels = [
        (8, 8), (12, 8), (16, 8),     # 顶部
        (8, 12), (16, 12),            # 中间
        (8, 16), (12, 16), (16, 16),  # 中间
        (8, 20), (8, 24)              # 底部
    ]
    
    # 绘制像素
    pixel_size = 4
    for x, y in pixels:
        draw.rectangle(
            [x, y, x + pixel_size - 1, y + pixel_size - 1],
            fill=primary_color
        )
    
    # 保存图像
    img.save('app/static/icons/logo.png')

if __name__ == '__main__':
    create_pixel_logo() 